import 'package:json_annotation/json_annotation.dart';

part 'life_topic_comment_list_api.g.dart';

@JsonSerializable()
class ResponseLifeTopicCommentListApi {
  final int total;
  final List<TopicComment>? rows;

  ResponseLifeTopicCommentListApi(this.total, this.rows);

  factory ResponseLifeTopicCommentListApi.fromJson(Map<String, dynamic> json) =>
      _$ResponseLifeTopicCommentListApiFromJson(json);
}

@JsonSerializable()
class TopicComment {
  final String id;
  final String topicId;
  final String userId; //帖子类型(0:官方帖子;1:用户帖子;2:品牌视频)
  final String? nickName; //用户头像地址
  final String? userAvatar; //博主昵称
  final String? content;
  final String? imageSrc; // 帖子内容，可能是一串富文本。
  final bool? isOfficial; // 是否官方
  final bool? isLz; // 是否楼主
  final bool? reply; // 品牌商是否已回复
  final String? replyTime; // 品牌商回复时间
  final int? checkStatus; // 审核状态 0待审核 1审核通过 2审核拒绝
  final String? region;
  final bool? isLike; // 我是否点赞过
  final int? likes; // 我是否关注过该帖子博主
  final bool? isMyComment; // 帖子发布状态（0=未发布，1=已发布）
  final String? createTime; // 
  final bool? isMain; // 是否主评论
  final List<TopicComment>? children; 


  factory TopicComment.fromJson(Map<String, dynamic> json) =>
      _$TopicCommentFromJson(json);

  TopicComment({
    required this.id,
    required this.topicId,
    required this.userId,
    required this.nickName,
    required this.userAvatar,
    required this.content,
    required this.imageSrc,
    required this.isOfficial,
    required this.isLz,
    required this.reply,
    required this.replyTime,
    required this.checkStatus,
    required this.region,
    required this.likes,
    required this.isLike,
    required this.isMyComment,
    required this.createTime,
    required this.isMain,
    required this.children,
  });
}
